package com.sinochem.yunlian.ship.common.enums;

import lombok.Getter;

/**
 * @Auther: zzd
 * @Dscription: 订单状态
 * @Date: Create in 2017/11/20 16:05
 **/
public enum OrderStatus {
    WAITING_HANDLER(0 , "待处理"),
    EXECUTING(1 , "执行中(已去除)"),
    COMPLETED(2 , "已完成"),
    CANCEL(3 , "已取消"),
    ALL(9 , "全部");

    @Getter
    private int code;
    @Getter
    private String name;

     OrderStatus(int code, String name){
         this.code = code;
         this.name = name;
    }


    public static String valueOf(int code){
        switch (code){
            case 0 :
                return WAITING_HANDLER.name;
            case 1 :
                return EXECUTING.name;
            case 2 :
                return COMPLETED.name;
            case 3 :
                return CANCEL.name;
        }
        return "";
    }

}
